Add Book to My BookshelfPurchase This Book Online

Chapter 3 - Configuring Cisco Routers

Cisco TCP/IP Routing Professional Reference
Chris Lewis
  Copyright © 1999 The McGraw-Hill Companies, Inc.

Setting Up a Lab
By this stage, we have covered the basics of TPC/IP operation, how to use the Cisco router user interface, and how to change addresses on router ports. What we are going to do is to set up a lab for purposes of experiment. If you want to do this yourself, you need three Cisco 2500-series routers, a hub, and what is known as a Cisco DTE/DCE cable. (We will define a DTE and DCE, and explain their importance, later in this section.) This is a minimal set of equipment, which allows us to do meaningful work without the need to dedicate a high-end router to this task.
The physical connections for the internetwork on which we are going to experiment are shown in Fig. 3-5. The router configurations are shown in Fig. 3-6.
Figure 3-5: Three-router lab configuration
Configuration for router 1
Hostname router1
!
enable secret 5 $1$W6qH$DTNrEHmJm6QqYcMu5PRh.
enable password test
!
interface Ethernet0
ip address 120.1.1.1 255.0.0.0
!
interface Serial0
no ip address
shutdown
!
interface Serial1
no ip address
shutdown
!
line con0
line aux 0
transport input all'
line vty 0 4
password access
login
!
end
Configuration for router 2
version 10.3
!
hostname router2
!
enable secret 5 $1$/P2r$ob00lmzYqpogV0U1g1O8U/
enable password test
!
interface Ethernet0
ip address 120.1.1.2 255.0.0.0
!
interface Serial0
ip address 150.1.1.1 255.255.0.0
!
interface Serial1
no ip address
shutdown
!
!
line con 0
line aux 0
line vty 0 4
password ilx
login
!
end
Configuration for router 3
Current configuration:
!
version 10.3
!
hostname router3
!
enable secret 5 $1$cNaQ$a4jcvrXlzVO4cwJB7RP5j1
enable password test
!
interface Ethernet0
ip address 193.1.1.1 255.255.255.0
shutdown
!
interface Serial0
ip address 150.1.1.2 255.255.0.0
clockrate 64000
!
interface Serial1
no ip address
shutdown
!
!
line con 0
line aux 0
transport input all
line vty 0 4
password ilx
login
!
end
Figure 3-6: Initial configuration files for the three lab routers
The only entry that should be unfamiliar in these router configurations is the clockrate 64000 entry in router 3. To understand why this is there, we need to understand how router serial ports normally communicate via digital modem devices (normally referred to as CSU/DSU).
To permanently connect two routers located in disparate locations, with a data transmission rate of 56 kbps or higher, you normally will use a digital leased line. The digital leased line terminates in a CSU/DSU, which is then connected to the router serial ports at both ends of the link, as shown in Fig. 3-7.
Figure 3-7: Router to CSU/DSU connection
In datacomm-speak, the router serial port will be configured as a DTE, which stands for Data Terminal Equipment. The CSU/DSU will be configured as DCE, for Data Communications Equipment. Why is this important? Because of the  functions of the connector pins on each device.
Most people are somewhat familiar with the RS-232 serial interface specification. In this specification, pin 2 is transmit data (Tx) and pin 3 is receive data (Rx). When a PC is connected to a modem, we have a DTE connected to a DCE and use a straight-through cable, meaning that pins 1 through 25 on one end of the cable are connected to the corresponding pins on the other end of the cable. If we want to connect a PC serial port to a printer serial port, we would be connecting two DTE devices, so we'd use a crossover cable. This cable eliminates the need for a modem by physically connecting pin 2 on one end of the cable to pin 3 on the other end, and vice versa.
This is necessary; otherwise both DTE devices would try to transmit data on the same connector pin. This is a problem because each pin has only unidirectional functionality, meaning that it can be used either for sending or receiving signals. The simple rule to remember is that a DTE communicates with a DCE; DCE-to-DCE or DTE-to-DTE connections need something devious in the cabling to make them work.
The same concept holds true in the Cisco world. The Cisco serial port has 60 connector pins; the function of each pin depends on whether the port is configured as a DTE or a DCE. The next question is how a port decides whether it should be a DTE or DCE, and how you can tell.
The Cisco serial port has 60 pins, far more than you need to transmit and control data, and some of the pins are dedicated to "sensing" which cable is connected. The way it works is that each Cisco cable has a certain number of pins connected together (effectively looping pins together on each end of the cable), giving every cable a unique configuration. When the cable is plugged into the serial port, the port can tell which pins are looped together, and as a result, decides whether it will be a DTE or DCE.
With a Cisco 2500 and a Cisco DTE/DCE cable, this effect easily can be seen; plug one end of the DTE/DCE cable into the Serial 0 port of the router, and issue the following command:
Router2>show controllers serial 0
The displayed output will be as shown in Fig. 3-8.
HD unit 0, idb = 0x80668, driver structure at 0x820E8
buffer size 1524 HD unit 0, V.35 DTE cable
cpb = 0x11, eda = 0x4800, cda = 0x4814
Rx ring with 16 entries at 0x114800
00 bd_ptr=0x4800 pak=0x084018 ds=0x11D840 status=80 pak_size=22
01 bd_ptr=0x4814 pak=0x083BB0 ds=0x11C418 status=80 pak_size=0
01 bd_ptr=0x4814 pak=0x083BB0 ds=0x11C418 status=80 pak_size=0
02 bd_ptr=0x4828 pak=0x083D28 ds=0x11CAD0 status=80 pak_size=0
03 bd_ptr=0x483C pak=0x083EA0 ds=0x11D188 status=80 pak_size=0
04 bd_ptr=0x4850 pak=0x084190 ds=0x11DEF8 status=80 pak_size=0
05 bd_ptr=0x4864 pak=0x084308 ds=0x11E5B0 status=80 pak_size=0
06 bd_ptr=0x4878 pak=0x084480 ds=0x11EC68 status=80 pak_size=0
07 bd_ptr=0x488C pak=0x0845F8 ds=0x11F320 status=80 pak_size=0
08 bd_ptr=0x48A0 pak=0x082D00 ds=0x1180E8 status=80 pak_size=0
09 bd_ptr=0x48B4 pak=0x082E78 ds=0x1187A0 status=80 pak_size=0
10 bd_ptr=0x48C8 pak=0x082FF0 ds=0x118E58 status=80 pak_size=0
11 bd_ptr=0x48DC pak=0x083168 ds=0x119510 status=80 pak_size=0
12 bd_ptr=0x48F0 pak=0x0832E0 ds=0x119BC8 status=80 pak_size=0
13 bd_ptr=0x4904 pak=0x0835D0 ds=0x11A938 status=80 pak_size=0
14 bd_ptr=0x4918 pak=0x083748 ds=0x11AFF0 status=80 pak_size=0
15 bd_ptr=0x492C pak=0x0838C0 ds=0x11B6A8 status=80 pak_size=0
16 bd_ptr=0x4940 pak=0x083A38 ds=0x11BD60 status=80 pak_size=0
cpb = 0x11, eda = 0x5000, cda = 0x5000
TX ring with 4 entries at 0x115000
00 bd_ptr=0x5000 pak=0x000000 ds=0x000000 status=80 pak_size=0
01 bd_ptr=0x5014 pak=0x000000 ds=0x000000 status=80 pak_size=0
02 bd_ptr=0x5028 pak=0x000000 ds=0x000000 status=80 pak_size=0
03 bd_ptr=0x503C pak=0x000000 ds=0x000000 status=80 pak_size=0
04 bd_ptr=0x5050 pak=0x000000 ds=0x000000 status=80 pak_size=0
0 missed datagrams, 0 overruns
0 bad datagram encapsulations, 0 memory errors
0 transmitter underruns
Figure 3-8: Output of show controllers command with DTE cable
Look at the shaded line and disregard the rest of the screen output for the moment. With this end of the cable, the port is sensing that it should assume a DTE configuration. Now disconnect the DTE/DCE cable and plug the other end into the serial port. Issuing the same command displays the information shown in Fig. 3-9.
HD unit 0, idb = 0x7AA6C, driver structure at 0x7C528
buffer size 1524 HD unit 0, V.35 DCE cable clockrate 64000
cpb = 0x21, eda =  0x4940, cda = 0x4800
Rx ring with 16 entries at 0x214800
00 bd_ptr=0x4800 pak=0x07E030 ds=0x214C418 status=80 pak_size=0
01 bd_ptr=0x4814 pak=0x07E1AC ds=0x21CAD0 status=80 pak_size=0
02 bd_ptr=0x4828 pak=0x07E328 ds=0x21D188 status=80 pak_size=0
03 bd_ptr=0x483C pak=0x07E4A4 ds=0x21D840 status=80 pak_size=0
04 bd_ptr=0x4850 pak=0x07E620 ds=0x21DEF8 status=80 pak_size=0
05 bd_ptr=0x4864 pak=0x07E79C ds=0x21E5B0 status=80 pak_size=0
06 bd_ptr=0x4878 pak=0x07E918 ds=0x21EC68 status=80 pak_size=0
07 bd_ptr=0x488C pak=0x07EA94 ds=0x21F320 status=80 pak_size=0
08 bd_ptr=0x48A0 pak=0x07D158 ds=0x2180E8 status=80 pak_size=0
09 bd_ptr=0x48B4 pak=0x07D450 ds=0x218E58 status=80 pak_size=0
10 bd_ptr=0x48C8 pak=0x07D5CC ds=0x219510 status=80 pak_size=0
11 bd_ptr=0x48DC pak=0x07D748 ds=0x219BC8 status=80 pak_size=0
12 bd_ptr=0x48F0 pak=0x07D8C4 ds=0x21A280 status=80 pak_size=0
13 bd_ptr=0x4904 pak=0x07DA40 ds=0x21A938 status=80 pak_size=0
14 bd_ptr=0x4918 pak=0x07DBBC ds=0x21AFF0 status=80 pak_size=0
15 bd_ptr=0x492C pak=0x07DD38 ds=0x21B6A8 status=80 pak_size=0
16 bd_ptr=0x4940 pak=0x07DEB4 ds=0x21BD60 status=80 pak_size=0
cpb = 0x21, eda = 0x503C, cda = 0x503C
TX ring with 4 entries at 0x215000
00 bd_ptr=0x5000 pak=0x000000 ds=0x200078 status=80 pak_size=22
01 bd_ptr=0x5014 pak=0x000000 ds=0x200078 status=80 pak_size=22
02 bd_ptr=0x5028 pak=0x000000 ds=0x200078 status=80 pak_size=22
03 bd_ptr=0x503C pak=0x000000 ds=0x200078 status=80 pak_size=22
04 bd_ptr=0x5050 pak=0x000000 ds=0x200078 status=80 pak_size=22
0 missed datagrams, 0 overruns
0 bad datagram encapsulations, 0 memory errors
0 transmitter underruns
Figure 3-9: Output of show controllers command with DCE cable
As you can see, the port has sensed a different cable connector configuration and has configured itself to be a DCE.
By using the DTE/DCE cable to connect router 2 and router 3 together (Fig. 3-5), the two serial ports will be able to communicate, with one configured as DTE and the other as DCE.
So far, so good. The question remains, however, as to why there is the clockrate 64000 entry in the configuration of router 3. Referring back to Fig. 3-7, we see that router serial ports normally are connected to a CSU/DSU. Cisco serial ports use synchronous communication, which means a separate clock source is used to synchronize the router interaction with the CSU/DSU. Normally that clock signal is supplied by the CSU/DSU (which, in turn, is normally configured to take its clock signal from the network of the telephone company supplying the leased line).
In the lab environment there are no CSU/DSUs, so we have to tell one of the ports to generate a clock signal, to mimic what the CSU/DSU would normally provide. The clockrate command only takes effect for a port that is configured as a DCE.
The clockrate 64000 command tells the port (if it is configured as a DCE) to generate a clock signal that simulates the port being connected to a 64 kbps line. Other values to simulate other line speeds are available.
We now will begin to explore the TCP/IP communication process between these three routers.
The ICMP ping command, which stands for Packet Internet Groper, sends a packet to a specified destination and requests a response. Let's see what happens if we try to ping router 2 from router 1. At the command prompt of router 1, input the following:
Router1>ping 120.1.1.2
The router will display the following on the screen:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 120.1.1.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 28/75/112 ms
Why are only four of five packets returned? Could it be that a packet gets lost occasionally? Well, let's try it again.
Router1>ping 120.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 120.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
This time all five packets sent receive a reply. Try it as many times as you like and you'll see that every packet sent gets a reply. To understand why this happens, we must consider what the router is doing when a ping packet is sent. The router has to construct a correctly formatted Ethernet packet, with the necessary addresses to get from source to destination.
To do this, the router must identify the following four addresses:
  Source MAC address
  Source IP address
  Destination MAC address
  Destination IP address
The router knows its own MAC and IP address, and the ping command defined the destination IP address. What is missing is the destination MAC address. In Chap. 2 we discussed the ARP protocol, which maintains the ARP table that maps MAC addresses to IP addresses. When router 1 first tries to send out a ping packet, it does not have the MAC address of router 2, so it cannot complete the construction of the first ping packet. It then sends out a broadcast ARP request to find out the MAC address of router 2. (Router 1 actually tries to find out the MAC address associated with the destination IP address specified in the ping command.) Once router 2 replies, the MAC/IP address pair is put in the ARP table. When router 1 tries to send a packet to router 2 a second time, it has all the information and the ping packet can be correctly constructed. That is why only the very first ping fails and all other pings succeed.
We can demonstrate this interaction as follows. Input the following on router 1:
Router1>show ip arp
ProtocolAddressAge (min)Hardware AddrTypeInterface
Internet120.1.1.1-0000.0c47.42ddARPAEthernet0
Internet120.1.1.220000.0c47.0457ARPAEthernet0
Turn off router 1 and then turn it back on. When presented with the router prompt, input the same command. The output now shows the following:
Router1>sho ip arp
ProtocolAddressAge (min)Hardware AddrTypeInterface
Internet120.1.1.1-0000.0c47.42ddARPAEthernet0
As you can see, after the router is rebooted, only its own MAC address is in the ARP table. To ping router 2, an ARP broadcast must be sent to determine the MAC address of router 2.
Now, try the same thing from router 2 to ping router 3. Input the following to router 2:
Router2>ping 150.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/30/32 ms
The success rate is 100 percent the first time out. Why did this work on the first try, and the ping from router 1 to router 2 didn't? The answer is that the communication from router 2 to router 3 uses the Cisco default Data Link protocol for a serial port, which is HDLC. HDLC is used for point-to-point links that do not have MAC addresses associated with them. Therefore router 2 has all the information it needs to send a ping packet out on a serial port.
We have reached the point where router 1 can ping router 2 and router 2 can ping router 3. Should router 1 be able to ping router 3?  Try that by entering the following into router 1:
Router1>ping 150.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.1.2, timeout is 2 seconds:
……
Success rate is 0 percent (0/5)
As you can see, it does not work. To solve this problem, we need to look at the routing table, often a good place to start when troubleshooting router problems. We can display the routing table by inputting the following to router 1:
Router1>show ip route
Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
C120.0.0.0 is directly connected, Ethernet0
As you can see, the routing table has entries only for the 120.0.0.0 network. (Remember, we configured the port with default subnet masks, so having a first octet value of 120 means we have a class A network, and therefore only the first octet is used to identify the network number.) In this instance, the router realizes that the destination address, 150.1.1.2, is on the 150.1.0.0 network (a class B network). The router will realize that this is not a directly connected network and will refer to its routing table to determine which router should get the ping packet in order to reach the 150.1.0.0 network. Clearly, without an entry in its routing table for the 150.1.0.0 network, the router can go no further.
You can enter the route directly into the router's routing table with the following input:
Router1>ena
Password:
Router1#conf t
Enter configuration commands, one per line. End with Ctrl/Z.
Router1(config)#ip route 150.1.0.0 120.1.1.2
Router1(config)#<Ctrl-Z>
Router1#
This tells router 1 that the next router to go to on the way to the 150.1.0.0 network is that with the address 120.1.1.2. This is shown in the routing table as follows:
router1>show ip route
Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D- EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i- IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
C120.0.0.0 is directly connected, Ethernet0
S150.1.0.0 [1/0] via 120.1.1.2
So what happens if we now try to ping 150.1.1.2 from router 1?
Router1>ping 150.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.1.2, timeout is 2 seconds:
……
Success rate is 0 percent (0/5)
It still fails. What happens is that router 1 now knows to pass the packet to router 2 to get to the 150.1.0.0 network. Once the packet is delivered to router 3, router 3 will try to reply to 120.1.1.1. Router 3 does not have a route to the 120.0.0.0 network, so the ping fails again. To resolve this, we need to add a route to the 120.0.0.0 network in the routing table of router 3. This is done as follows:
Router3(config)#ip route 120.0.0.0 150.1.1.1
Router3(config)#<Ctrl-Z>
Router3#
The routing table of router 3 now looks like this:
Router3#sho ip route
Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D- EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i- IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
S120.0.0.0 [1/0] via 150.1.1.1
C150.1.0.0 is directly connected, Serial0
Note that the routes entered are either static (meaning they are in the router's configuration), or connected (meaning they are directly connected to one of the router's interfaces).
Now if we go back to router 1 and ping router 3, we see what we wanted to see all along:
Router1>ping 150.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/30/32 ms
Adding routes manually in this fashion rapidly becomes cumbersome for a growing network. To automate the routing table update process, routing protocols are run on the routers. Chapter 4 covers routing protocols in depth; at this time, however, we shall look in overview at the configuration of Cisco's Interior Gateway Routing Protocol (IGRP).
We are now going to remove the static routes we configured in the routers and configure IGRP on each router so that it will make the required entries in the routing table for us.
First, remove the static routes. To do this type the following into router 1:
Router1#no ip route 150.1.0.0 120.1.1.2
Into router 3, type the following:
Router3#no ip route 120.0.0.0 150.1.1.1
This introduces the "no" form of command. Whenever you need to remove an entry in the router's configuration, simply enter configuration mode and type the word "no" followed by the configuration entry you want to remove.
Making standard IGRP a running process on all three routers is a simple configuration change, and can be executed as follows for router 2:
Router2#conf t
Router2(config)#router igrp 9
Router2(config-router)#network 150.1.0.0
Router2(config-router)#network 120.0.0.0
Router2(config-router)#<Ctrl-Z>
Once you have entered configuration mode, you define the router process IGRP as belonging to an Autonomous System number 9. It does not matter what number you assign as the Autonomous System number in this case. All you need do is assign the same number to all three router IGRP processes. IGRP processes simply will exchange route information with other processes belonging to the same Autonomous System number.
The two network entries are there to tell IGRP what networks to advertise in its initial IGRP packet. The rule to follow is that you must configure a network entry for each directly connected network number. Note that, because IGRP does not send subnet mask information in its updates, the entries here are concerned only with network (not subnetwork) numbers.
The entries for router 1 and router 3 are made as follows:
Router1#conf t
Router1(config)#router igrp 9
Router1(config-router)#network 120.0.0.0
Router1(config-router)#<Ctrl-Z>
Router3#conf t
Router3(config)#router igrp 9
Router3(config-router)#network 150.1.0.0
Router3(config-router)#<Ctrl>Z
The three router configurations now appear as shown in Fig. 3-10.
Router 1
router1#wr t
Building configuration…
Current configuration:
!
version 10.3
!
hostname router1
!
enable secret 5 $1$W6qH$DTNrEHmJrn6QqYcMu5PRh.
enable password test
!
interface Ethernet0
ip address 120.1.1.1 255.0.0.0
!
interface Serial0
no ip address
shutdown
!
interface Serial1
no ip address
shutdown
!
router igrp 9
network 120.0.0.0
!
line con 0
line aux 0
transport input all
line vty 0 4
password ilx
login
!
end
Router 2
Building configuration:
Current configuration:
!
version 10.3
!
hostname router2
!
enable secret 5 $1$/P2r$ob00lmzYqpogV0U1g1O8U/
enable password test
!
interface Ethernet)0
ip address 120.1.1.2 255.0.0.0
!
interface Serial0
ip address 150.1.1.1 255.255.0.0
!
interface Serial1
no ip address
shutdown
!
router igrp 9
network 120.0.0.0
network 150.1.0.0
!
line con 0
line aux 0
line vty 0 4
password ilx
login
!
end
Router 3
Building configuration:
Current configuration:
!
version 10.3
!
hostname router3
!
enable secret 5 $1$cNaQ$a4jcvrXlzVO4cwJB7RP5j1
enable password test
!
interface Ethernet0
ip address 193.1.1.1 255.255.255.0
!
interface Serial0
ip address 150.1.1.2 255.255.0.0
clockrate 64000
!
interface Serial1
no ip address
shutdown
!
router igrp 9
network 150.1.0.0
!
line con 0
exec-timeout 0 0
line aux 0
transport input all
line vty 0 4
password ilx
login
!
end
Figure 3-10: Lab router configuration with IGRP enabled
After a few minutes have elapsed, IGRP will have advertised the network numbers throughout this small internetwork and have updated the routing tables with appropriate entries. The routing table for router 1 is as shown here:
Router1>show ip route
Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D- EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i- IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
C120.0.0.0 is directly connected, Ethernet0
I150.1.0.0 [100/8576] via 120.1.1.2, 00:01:20, Ethernet0
And the routing table for router 3 is as follows:
Router3>show ip route
Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
I120.0.0.0 [100/8576] via 150.1.1.1, 00:01:14, Serial0
C150.1.0.0 is directly connected, Serial0
The thing to note is that the routing table indicates that the routes necessary for router 1 and 3 to ping each other were learned from IGRP and are no longer static routes as they were originally.
It is now worth exploring the application of subnets in a real environment. What we are about to do is configure all ports on this small internetwork to be in subnets of the network number 160.4.0.0. To accomplish this, we need to change the address and netmask of all ports and the IGRP configuration for each router. For router 1, these changes are put into effect by the following input:
Router1(config)#int e0
Router1(config-int)#ip address 160.4.1.33 255.255.255.224
Router1(config-int)#exit
Router1(config)#router igrp 9
Router1(config-router)#no network 120.0.0.0
Router1(config-router)#network 160.4.0.0
Router1(config-router)#<Ctrl-Z>
The configuration for router 1 is illustrated in Fig. 3-11. To configure router 2 and view its configuration, follow the commands shown in Fig. 3-12. In order to configure router 3, use the commands shown in Fig. 3-13.
!
version 10.3
!
hostname router1
!
enable secret 5 $1$W6qH$DTNrEHmJrn6QqYcMu5PRh.
enable password test
!
interface Ethernet0
ip address 160.4.1.33 255.255.255.224
!
interface Serial0
no ip address
shutdown
!
interface Serial1
no ip address
shutdown
!
router igrp 9
network 160.4.0.0
!
line con 0
line aux 0
transport input all
line vty 0 4
password ilx
login
!
end
Figure 3-11: Router 1 configured for subnets
Router2# conf t
Enter configuration commands, one per line. End with CtrlZ
Router2(config)#int e0
Router2(config-int)#ip address 160.4.1.34 255.255.255.224
Router2(config-int)#int s0
Router2(config-int)#ip address 160.4.1.65 255.255.255.224
router2(config-if)# exit
router2(config)#router igrp 9
router2(config-router)# no net 120.0.0.0
router2(config-router)#no net 150.1.0.0
router2(config-router)# net 160.4.0.0
router2(config-router)# <ctrl>Z
router2#
The configuration for router 2 now looks like the following:
router2# wr t
Building configuration…
Current configuration:
!
version 10.3
!
hostname router2
!
enable secret 5 $1$/P2r$ob00lmzYqpogV0U1g1O8U/
enable password test
!
interface Ethernet0
ip address 160.4.1.34 255.255.255.224
!
interface Serial0
ip address 160.4.1.65 255.255.255.224
!
interface Serial1
no ip address
shutdown
!
router igrp 9
network 160.4.0.0
!
line con 0
line aux 0
line vty 0 4
password ilx
login
!
end
Figure 3-12: Router 2 configured for subnets
Router3# conf t
Enter configuration commands, one per line. End with CNTL/Z.
router3(config)# int s0
router3(config-if)# ip address 160.4.1.66 255.255.255.224
router3(config-if)# exit
router3(config)#router igrp 9
router3(config-router)#no net 150.1.0.0
router3(config-router)# net 160.4.0.0
router2(config-router)# exit
router3(confug)#
The configuration for router 3 now looks like the following:
router3# wr t
Building configuration…
Current configuration:
!
version 10.3
!
hostname router3
!
enable secret 5 $1$cNaQ$a4jcvrXlzVO4cwJB7RP5j1
enable password test
!
interface Ethernet0
ip address 193.1.1.1 255.255.255.0
shutdown
!
interface Serial0
ip address 160.4.1.66 255.255.255.224
clockrate 64000
!
interface Serial1
no ip address
shutdown
!
router igrp 9
network 160.4.0.0
!
line con 0
line aux 0
transport input all
line vty 0 4
password ilx
login
!
end
Figure 3-13: Router 3 configured for subnets
Note that when configuring IGRP, the same network number is defined on each router. In this case, when IGRP advertisements are received, it is assumed that the same subnet mask is used on all interfaces on the internetwork and the correct entries in the routing tables are then made. The routing tables now appear as follows:
Router1>show ip route
Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
160.4.0.0 255.255.255.224 is subnetted, 2 subnets
C 160.4.1.32 is directly connected, Ethernet0
I 160.4.1.64 [100/8576] via 160.4.1.34, 00:00:00, Ethernet0
Router2>show ip route
Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
160.4.0.0 255.255.255.224 is subnetted, 2 subnets
C  160.4.1.32 is directly connected, Ethernet0
C  160.4.1.64 is directly connected, Serial0
Router3>show ip route
Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
160.4.0.0 255.255.255.224 is subnetted, 2 subnets
I  160.4.1.32 [100/8576] via 160.4.1.65, 00:01:07, Serial0
C  160.4.1.64 is directly connected, Serial0
An interesting point is that the network number that is tracked in the routing table is a derived value. By looking at both the assigned IP address and the subnet mask, the subnetwork number is calculated. This effect can be clearly illustrated by changing the IP address of the serial port on router 3, keeping the subnet mask the same, then viewing the new routing table:
Router3(config)#interface serial 0
Router3(config-int)#ip address 160.4.1.100 255.255.255.224
The routing table now looks like this:
Router3>show ip route
Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
160.4.0.0 255.255.255.224 is subnetted, 2 subnets
I  160.4.1.32 [100/8576] via 160.4.1.65, 00:01:07, Serial0
C  160.4.1.96 is directly connected, Serial0
As you can see, the routing table automatically adjusted to keep track of a new network number associated with that interface, simply because you changed the IP address of that interface.
As a point of interest, this is the exact opposite of the way that NetWare protocols work. In NetWare, you assign one network number to a server and all workstations on that network work out their own address. With TCP/IP, you assign addresses and a subnet mask to all workstation interfaces and the network number is calculated from that. We will be discussing the NetWare protocols more fully in Chap. 5.

 


 
Books24x7.com, Inc © 2000 –  Feedback